1. Technical Field
The present disclosure relates generally to information processing systems and, more specifically, to managing a shared memory region for a heap and a compiled code cache in managed runtime environments.
2. Background Art
Platform-independent high-level programming languages such as Java and C# have gained significant market presence, especially for network-based applications. Typically, programs written in these languages execute in a managed runtime environment (MRTE) that provides automatic memory management, type management, threads and synchronization, and dynamic loading facilities.
The automatic memory management provided by an MRTE typically includes management of a heap and management of a compiled code cache. A heap is an area of memory reserved for the dynamic memory allocation needs of an application. It is thus reserved for data that is created at runtime, usually because the size, quantity, or lifetime of an object to be allocated could not be determined at compile time. For devices with a small memory footprint, such as mobile devices including cellular telephones and personal digital assistants, management of this relatively limited memory area in order to maximize available storage capacity is a key objective.
Regarding the MRTE's management of a compiled code cache, it should be understood that MRTEs typically support just-in-time compilation. Programs written in high-level programming languages such as Java and C# typically are first compiled to codes in a platform-neutral distribution format called bytecode. The compiled bytecode typically is not directly run on a platform.
While an MRTE may directly interpret bytecodes, this is not typically done unless memory is exceedingly limited. MRTE interpretation of bytecodes may significantly reduce performance. Instead, an MRTE typically includes a just-in-time compiler that translates, on demand, an application's bytecode instructions into native instructions for the processor on which the MRTE is executing. The native instructions are stored in a compiled code cache.
Because native code is typically several times larger than its bytecode counterpart, MRTEs for limited memory devices carefully manage the code cache to provide as much storage capacity as possible during execution of the application program.